<template>
    <div>
        <h1>员工管理</h1>
        <ListEmployee :page="employeePage" @page="findByItem" @show="show"></ListEmployee>
        <AddEmployee @page="findByItem"></AddEmployee>
        <UpdateEmployee :employee="employeeObj" @page="findByItem"></UpdateEmployee>
    </div>
</template>

<script>
import AddEmployee from "./EmployeeManager/AddEmployee.vue"
import UpdateEmployee from "./EmployeeManager/UpdateEmployee.vue"
import ListEmployee from "./EmployeeManager/ListEmployee.vue"

export default {
    components:{AddEmployee,UpdateEmployee,ListEmployee},
    data(){
        return{
            employeePage:{},
            employeeObj:{}
        }
    },
    methods:{
        async findByItem(param){
            var pageList = await this.ajax.getSubmit("/project/employee/findByItem",param);
            this.employeePage = pageList;
        },
        show(obj){
            this.employeeObj = obj;
        }
    },
    created(){
        this.findByItem({pageNO:1});
    }
}
</script>

<style>

</style>